package book;

public class Book{
    private String name;//书名
    private String author;//作者
    private int price;//价格
    private String type;//类型
    private boolean lend;//是否借出

    public Book(String name, String author, int price, String type) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
    }

    @Override
    public String toString() {
        return "Book{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", price=" + price +
                ", type='" + type + '\'' +
                ", " + (lend == true ? "已借出" : "未借出") +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setLend(boolean lend) {
        this.lend = lend;
    }

    public boolean getLend() {
        return lend;
    }
}
